package com.ezhou.hy.common;

import java.io.IOException;
import java.io.Reader;
import java.util.Properties;
import java.util.Set;

import org.apache.log4j.Logger;

import com.ezhou.hy.common.xml.XMLDaoManager;
import com.ezhou.hy.exception.DaoException;



/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>CopyRight:Copyright (c) 2008.12 </p>
 * <p>Company: </p>
 * @author Haiger
 * @version 1.0
 */
public class DaoMap {
	
	private static Logger log = Logger.getLogger(DaoMap.class);
	private static DaoMap daoMap = new DaoMap();
	
	private DaoMap(){
		
	}
	
	public static DaoMap getInstance(){
		return daoMap;
	}
	
	public Properties getDaoProperties() throws DaoException, IOException{
		Reader reader = Resources.getResourceAsReader("daoconfig.xml");
		return new XMLDaoManager().getDaoProperties(reader);
	}

/*
	public static void main(String args[]){
		Properties props = new Properties();
		try {
			props = DaoMap.getInstance().getDaoProperties();
		} catch (DaoException e) {
			System.out.println("DaoException");
			e.printStackTrace();
		} catch (IOException e) {
			System.out.println("IOException");
			e.printStackTrace();
		}
//		Set<String> set = props.stringPropertyNames();
//		Object[] obj = set.toArray();
//		for(int i=0;i<obj.length;i++){
//			System.out.println(obj[i]);
//		}
//		System.out.println(set.size());
		System.out.println(props.getProperty("tttdao"));
//		System.out.println(props.getProperty("implements"));
	}
*/
}
